a=[]
p=0
for i in range(1,1001):
    a.append(i)
j=len(a)/3
while 1:
    del a[j*3-1]
    j=j-1
    if j==0:
        j=len(a)/3
        p=p+1
    if len(a)==3:
        print a[2]
        print p
        break